# Contributor: Rasmus Thomsen <oss@cogitri.dev>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=py3-skia-pathops
pkgver=0.7.4
pkgrel=1
pkgdesc="Python bindings for the Skia library's Path Ops"
url="https://github.com/fonttools/skia-pathops"
arch="all !s390x" # doesn't support big endian
license="BSD-3-Clause"
depends="python3 cython"
makedepends="
	gn
	py3-gpep517
	py3-setuptools
	py3-setuptools_scm
	py3-wheel
	python3-dev
	samurai
	"
checkdepends="py3-pytest-xdist"
subpackages="$pkgname-pyc"
source="https://files.pythonhosted.org/packages/source/s/skia-pathops/skia-pathops-$pkgver.zip
	gn-ninja.patch
	"
builddir="$srcdir/skia-pathops-$pkgver"
options="net"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--config-json '{"no-fetch-gn": true}' \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest -n auto -p no:warnings
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
71df9b0b237a70af2246a30d53e201da493deb7a098dd969c346745c60997df1aeb1b20d4c94c2443b1c710c464272b44e9225d58ac3a9fd1074816839ae797b  skia-pathops-0.7.4.zip
1df0382cfb70a7cacad2ed68b6fe50c47835d613045ab2a3b403c02b7d16e88606adbd2b3f4db01afd7998673b4844632fe2405aa2d234917fd59e7de41ae595  gn-ninja.patch
"
